<layout name="Iflayout"/>
<script src="/public/js/jquery.js"></script>
<script>
    $(function(){
        $('.label-danger').click(function(){
            if(confirm('确定删除?')){
                var _id = $(this).attr('m');
                var _this = $(this);
                $.post("{:U('Role/del')}", {id:_id}, function(data){
                    if(data){
                        alert('删除成功');
                        _this.parent().parent().remove();
                    }else{
                        alert('删除失败');
                    }
                })
            }
        })
    })
</script>
<div class="xyh-content">

    <div class="row">
        <div class="col-lg-12">
            <h3 class="page-header"><em class="glyphicon glyphicon-cloud-upload"></em>
                系统角色表
            </h3>
        </div>

    </div>

    <div class="row margin-botton">
        <div class="col-sm-6 column">
            <div class="btn-group btn-group-md">
                <a href="{:U('Role/add')}"> <button class="btn btn-primary" type="button" ><em class="glyphicon glyphicon-plus-sign"></em> 添加角色</button></a>
                <a><button class="btn btn-default" type="button" onclick="doConfirmBatch('/xyhai.php?s=/Rbac/delUser/batchFlag/1', '确实要删除选择项吗？')"><em class="glyphicon glyphicon-remove-circle"></em> 删除</button></a>
            </div>
        </div>
        <div class="col-sm-6 text-right">
            <form class="form-inline" method="post" action="/xyhai.php?s=/Rbac/index">
                <div class="form-group">
                    <label class="sr-only" for="inputKeyword">关键字</label>
                    <input class="form-control" name="keyword" id="inputKeyword" placeholder="用户名称" value="" type="text">
                </div>
                <button type="submit" class="btn btn-default">搜索</button>
            </form>        </div>
    </div>

    <div class="row">
        <div class="col-lg-12">
            <form action="" method="post" id="form_do" name="form_do">
                <div class="table-responsive">
                    <table class="table table-hover xyh-table-bordered-out">
                        <thead>
                        <tr class="active">
                            <th><input id="check" type="checkbox"></th>
                            <th>编号</th>
                            <th>角色名</th>
                            <th>状态</th>
                            <th>说明</th>
                            <th class="text-right">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <foreach name="roleinfo" item="value" >

                        <tr>
                            <td><input name="key[]"  value="{$value.id}" type="checkbox"></td>
                            <td>{$value.id}</td>
                            <td>{$value.name}</td>
                            <td>{$value['status']?正常:锁定}</td>
                            <td>{$value.remark}</td>
                            <td class="text-right">
                                <a href="{:U('Access/index')}?id={$value.id}" class="label label-info">权限</a>
                                <a href="/xyhai.php?s=/Rbac/addRole/id/1" class="label label-success">编辑</a>
                                <a href="javascript:void(0)"  class="label label-danger" m="{$value['id']}">删除</a>

                            </td>

                        </tr>
                        </foreach>
                        </tbody>
                    </table>
                </div>
            </for

            <div class="row clearfix">
                <div class="col-md-12 column">
                    <div class="xyh-page">
                        <div><span class="rows">共 {$count}条记录</span>     </div>                    </div>
                </div>
            </div>

</form>
        </div>
    </div>



</div>

</body></html>